from DeepDict import DeepDict

adict = {}
bdict = DeepDict(adict).path('a.b.c').set('d', 1).path(['e', 'f']).set('g', 2)
print(adict)
print(bdict)
# {'a': {'b': {'c': {'d': 1, 'e': {'f': {'g': 2}}}}}}
# {'g': 2}
DeepDict.hooks_before_set.append(lambda x: x + 1 if isinstance(x, int) else x)

bdict.path('wow').set(['a', 'b', 'c'], [3, 4, 5])
print(adict)
print(bdict)
# {'a': {'b': {'c': {'d': 1, 'e': {'f': {'g': 2, 'wow': {'a': 4, 'b': 5, 'c': 6}}}}}}}
# {'a': 4, 'b': 5, 'c': 6}
